package com.zhang.boot.web.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author zhangshaobin
 * @Date 2020/11/10
 * @Description oss配置
 */
@Configuration
public class OSSConfig {

    @Value("${oss.access-key}")
    private String accessId;
    @Value("${oss.endpoint}")
    private String endpoint;
    @Value("${oss.secret-key}")
    private String secretKey;

    @Bean
    public OSS ossClient() {
        OSS ossClient = new OSSClientBuilder().build(endpoint, accessId, secretKey);
        return ossClient;
    }

}
